package common

import (
	"fmt"
	"os"

	"github.com/logrusorgru/aurora/v3"
)

// PrintError 打印错误并且退出
func PrintError(errorType string, errorMsg string) {
	fmt.Printf("%v: %v\n", aurora.Red(errorType), errorMsg)
}

// PrintErrorAndExit 打印错误并且退出
func PrintErrorAndExit(errorType string, errorMsg string) {
	fmt.Printf("%v: %v\n", aurora.Red(errorType), errorMsg)
	Exit()
}

// Exit 退出程序
func Exit() {
	os.Exit(0)
}
